package com.qk.management.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.qk.common.PageResult;
import com.qk.dto.log.LogDTO;
import com.qk.management.mapper.LogMapper;
import com.qk.management.service.LogService;
import com.qk.vo.log.LogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: byLengs
 * @Date: 2025/10/19 20:10
 * @Description:
 */
@Service
@SuppressWarnings("all")
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    @Override
    public PageResult<LogVO> log(LogDTO dto) {
        PageHelper.startPage(dto.getPage(), dto.getPageSize());
        Page<LogVO> page = logMapper.selectByPage(dto);
        return PageResult.<LogVO>builder()
                .total(page.getTotal())
                .rows(page.getResult())
                .build();
    }
}
